<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage<MvcCms.Data.Language>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Mvc Cms -
    <%=ViewData["PageTitle"]%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <style type="text/css">
        label.error
        {
            float: none;
            color: red;
            padding-left: .5em;
            vertical-align: top;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="contentpage-outerdiv">
        <h2>
            <%=ViewData["PageTitle"]%></h2>
        <span class="field-validation-error">&nbsp;<%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>
            <%=ViewData["message"].ToString()%>
        </span>
        <% using (Html.BeginForm("CreateLanguage", "BackOffice", FormMethod.Post, new { id = "form1" }))
           {%>
        <fieldset>
            <legend>Language Info</legend>
            <div>
                <p>
                    <label for="Title">
                        Name:</label>
                    <%= Html.TextBox("LanguageName", "", new { @class = "required" })%>
                    <%= Html.ValidationMessage("LanguageName", "")%>
                </p>
                <p>
                    <label for="Image Icon">
                        Icon Image Name:</label>
                    <%= Html.TextBox("IconName", "", new { @class = "required" })%>
                    <%= Html.ValidationMessage("IconName", "")%>
                </p>
                <p>
                    <label for="PathID">
                        Path ID:</label>
                    <%= Html.TextBox("PathID", "", new { @class = "required" })%>
                    <%= Html.ValidationMessage("PathID", "")%>
                </p>                
                <p>
                    <input type="submit" value="Save" />
                </p>
            </div>
        </fieldset>
        <% } %>
        <div>
            <%=Html.ActionLink("Back to List", "ManageLanguages") %>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptContent" runat="server">

    <script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $("#form1").validate({
            submitHandler: function(form) {
                form.submit();
            }
        });
        
    
    
    </script>

</asp:Content>
